#ifndef _DRAG_TRICK
#define _DRAG_TRICK


#include "ofMain.h"
#include "trick.h"
#include "videoBlobDetector.h"
#include "videoBlob.h"
#include "ofCvMain.h"


#include <vector>



class dragTrick : public trick {
	
	public:
		
		void setup();
		void update();
		void draw();
		void reset();
		void keyPressed(int key);
		
		void 		takeSnapshot();
		void 		clear();
		
		bool					bHaveBlobs;
		videoBlob				blob;
		bool 					bTakeSnapshot;
		bool 					bTakeTopLeftmostBlob;
		
		
		//-------------------------------------------- dragging:
		
		
		ofCvGrayscaleImage		meAsGray;
		ofCvGrayscaleImage		meAndedWithHand;
		int 					nFramesCovered;
		bool 					bUncovered;
		bool 					bShow;
		
		
		
		float 					fingerInMeEnergy[MAX_N_TRACKED_FINGERS];
		bool 					bAnyoneGotMe;
		int 					whoGotMe;
		ofPoint2f 				offset;
		
		
		bool 					bPlaying;
		std::vector<ofPoint2f> 	points;
		int 					playbackCounter;
		float 					vel;
		ofPoint2f				prevPoint;
		
};

#endif	


